/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.miit.elearning.vtutor.check;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import ru.miit.elearning.vtutor.wsclient.ZosCheckBundle;
import ru.miit.elearning.vtutor.wsclient.curriculum.VlLab;
import ru.miit.elearning.vtutor.wsclient.curriculum.VlStudent;

/**
 *
 * @author Cyclone
 */
public class ZOSCheckServiceClient {

    public static ZosCheckBundle getZosCheckBundle(int courseId, String tutorLogin) {
        ZosCheckBundle checkBundle = null;
        try { // Call Web Service Operation
            ru.miit.elearning.vtutor.wsclient.VirtualTutorIBMService service = new ru.miit.elearning.vtutor.wsclient.VirtualTutorIBMService();
            ru.miit.elearning.vtutor.wsclient.VirtualTutorIBM port = service.getVirtualTutorIBMPort();

            checkBundle = port.getZosCheckBundle(courseId, tutorLogin);
            //System.out.println("Result = "+result);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return checkBundle;
    }

    public static String getZosFtpServerHostByCourse(Integer courseId) {
        String ftpServerHost = null;


        try { // Call Web Service Operation
            ru.miit.elearning.vtutor.wsclient.VirtualTutorIBMService service = new ru.miit.elearning.vtutor.wsclient.VirtualTutorIBMService();
            ru.miit.elearning.vtutor.wsclient.VirtualTutorIBM port = service.getVirtualTutorIBMPort();
            // TODO initialize WS operation arguments here
            // TODO process result here
            ftpServerHost = port.getZosFtpServerHostByCourse(courseId);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return ftpServerHost;
    }

    public static List<VlStudent> getStudentsByCourse(int courseId) {
        List<VlStudent> studentList = null;
        try { // Call Web Service Operation
            ru.miit.elearning.vtutor.wsclient.curriculum.CurriculumService service = new ru.miit.elearning.vtutor.wsclient.curriculum.CurriculumService();
            ru.miit.elearning.vtutor.wsclient.curriculum.Curriculum port = service.getCurriculumPort();
            studentList = port.getStudentsByCourse(courseId);
        } catch (Exception ex) {
            Logger.getLogger(ZOSCheckServiceClient.class.getName()).log(Level.SEVERE, null, ex);
            ex.printStackTrace();

        }
        return studentList;
    }

    public static List<VlLab> getLabsByCourse(int courseId) {
        List<VlLab> labList = null;

        try { // Call Web Service Operation
            ru.miit.elearning.vtutor.wsclient.curriculum.CurriculumService service = new ru.miit.elearning.vtutor.wsclient.curriculum.CurriculumService();
            ru.miit.elearning.vtutor.wsclient.curriculum.Curriculum port = service.getCurriculumPort();

            labList = port.getLabsByCourse(courseId);
        } catch (Exception e) {
            Logger.getLogger(ZOSCheckServiceClient.class.getName()).log(Level.SEVERE, null, e);
            e.printStackTrace();
        }

        return labList;
    }
}
